﻿<local:BaseWindow x:Class="PDFRider.WndRotatePages"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:PDFRider"
    xmlns:ltl="clr-namespace:LocTranslate;assembly=LocTranslateLibrary"
    Title="{ltl:Translate loc_wndRotatePagesTitle}" Height="201" Width="351" WindowStartupLocation="CenterOwner"
    ShowInTaskbar="False" ResizeMode="NoResize" Style="{StaticResource GenericStyle}" WindowStyle="SingleBorderWindow" Icon="/PDFRider;component/PDFRider.ico">

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>

        <StackPanel Orientation="Horizontal">
            <TextBlock Text="{ltl:Translate loc_tbkPagesFrom}" Margin="5" VerticalAlignment="Center" />
            <local:IntervalTextBox Style="{StaticResource IntervalTextBox}" SelectAllText="True"
                                   IsValidInterval="{Binding IsValidPageStart}"
                                   Text="{Binding PageStart, UpdateSourceTrigger=PropertyChanged}" />
            <TextBlock Text="{ltl:Translate loc_tbkPagesTo}" Margin="5" VerticalAlignment="Center" />
            <local:IntervalTextBox Style="{StaticResource IntervalTextBox}" SelectAllText="True"
                                   IsValidInterval="{Binding IsValidPageEnd}"
                                   Text="{Binding PageEnd, UpdateSourceTrigger=PropertyChanged}" />
            <TextBlock Text="{ltl:Translate loc_tbkPagesOf}" Margin="5" VerticalAlignment="Center" />
            <TextBlock Text="{Binding NumberOfPages}" Margin="5" VerticalAlignment="Center" />
            <TextBlock Text="{Binding NumberOfPhysicalPages, StringFormat=({0})}" Margin="5" VerticalAlignment="Center" />
        </StackPanel>

        
        <Grid Grid.Row="1">
            <Grid.RowDefinitions>
                <RowDefinition />
                <RowDefinition />
                <RowDefinition />
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="200" />
            </Grid.ColumnDefinitions>

            <TextBlock Text="{ltl:Translate loc_interval}" Margin="5" VerticalAlignment="Center" />
            <ComboBox Grid.Column="1" Margin="5"
                      ItemsSource="{Binding PageIntervals}" SelectedItem="{Binding SelectedPageInterval}">
                <ComboBox.ItemTemplate>
                    <DataTemplate>
                        <TextBlock Text="{Binding Description}" />
                    </DataTemplate>
                </ComboBox.ItemTemplate>
            </ComboBox>

            <TextBlock Grid.Row="2" Text="{ltl:Translate loc_rotation}" Margin="5" VerticalAlignment="Center" />
            <ComboBox Grid.Row="2" Grid.Column="1" Margin="5"
                      ItemsSource="{Binding Rotations}" SelectedItem="{Binding SelectedRotation}">
                <ComboBox.ItemTemplate>
                    <DataTemplate>
                        <TextBlock Text="{Binding Description}" />
                    </DataTemplate>
                </ComboBox.ItemTemplate>
            </ComboBox>
        </Grid>
        
        

        <StackPanel Grid.Row="2" Visibility="Visible" >
            <TextBlock Style="{StaticResource InformationTextBlock}" Text="{Binding Information}" />
        </StackPanel>

        <StackPanel Grid.Row="3" Orientation="Horizontal" HorizontalAlignment="Right" Margin="5">
            <Button Content="{ltl:Translate loc_btnOK}" Command="{Binding CmdRotate}"
                    Style="{StaticResource StandardRectangleDialogButton}" IsDefault="True" />
            <Button Content="{ltl:Translate loc_btnCancel}" Command="{Binding CmdClose}"
                    Style="{StaticResource StandardRectangleDialogButton}" IsCancel="True" />
        </StackPanel>

    </Grid>
</local:BaseWindow>
